package com.wanxi.education.controller.front;

import com.wanxi.education.common.CommonResult;
import com.wanxi.education.model.vo.video.VideoFindByIdBackVo;
import com.wanxi.education.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @Author: 寇文宝
 * @Description:
 * @Date: Created in 2021/9/24
 * @Version: 1.0
 */
@Api(tags = "前端视频管理")
@RestController
@RequestMapping("/front/video")
public class VideoFrontController {
    @Autowired
    private VideoService videoService;

    @ApiOperation("前端页面查看视频")
    @GetMapping("/findById")
    @ApiParam(name = "id", value = "当前想要查看视频的id")
    public CommonResult findById(@RequestParam("id") Long id) {
        if (ObjectUtils.isEmpty(id)) {
            return CommonResult.validateFailed("视频id为空");
        }
        VideoFindByIdBackVo videoFindByIdBackVo = videoService.findById(id);
        return CommonResult.success(videoFindByIdBackVo);
    }


}
